home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Feb 90 / MacApp.Tech$ 2⁄16⁄90 / 0652-Re How to detect dbl-Feb90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.4 KB  |  51 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    2546274                         12-Feb-90        18:36PST
  4.  
  5. From:   SATORI                          Satori SW, Hugh Rogovy,PRT
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    re:How to detect dbl-clicking
  10.  
  11. ***SORRY, I DON'T KNOW WHAT HAPPENED TO MY ORIGINAL TRANSMISSION***
  12.  
  13. >> I would like to be able to detect whether a user has double-clicked or
  14. >> option-clicked on an icon…
  15.  
  16. Mark,
  17.  
  18. Off the top of my head……
  19.  
  20. Regarding the click count, I think you can just look at the variable
  21. gClickCount.
  22.  
  23. Due to the way that TControl objects handle mouse events, I think you're going
  24. to have to get the option-key the old fashioned way (somebody correct me if I'm
  25. wrong…) by using a keymap.  At first glance, I don't see anyway to get access
  26. to the event record without overriding the tracker command.  There may be
  27. international keyboard problems with the constant kOptionKey (?).
  28.  
  29.       *EXAMPLE*
  30.  
  31.     PROCEDURE TYourIcon.DoChoice(origView: TView; itsChoice: INTEGER);OVERRIDE;
  32.     CONST
  33.        kOptionKey = 58;
  34.     VAR
  35.        theKeyMap:  KeyMap;
  36.        OptionClick,
  37.        DublClick:  BOOLEAN;
  38.  
  39.     BEGIN
  40.        GetKeys(theKeyMap);
  41.        OptionClick:=(itsChoice=mIconHit) AND theKeyMap[kOptionKey];
  42.        DublClick:=gClickCount {>}= 2;
  43.        {do whatever it is you need to do…}
  44.            …
  45.     END;
  46.  
  47. Good Luck,
  48.  
  49.     Chris Le Croy
  50.  
  51.